home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Games #12
/
GEGA012.iso
/
Jogos de Azar
/
fruit.swf
/
scripts
/
C_DealButtonCLASS.as
< prev
next >
Wrap
Text File
|
2006-01-17
|
3KB
|
122 lines
_global.C_DealButtonCLASS = function()
{
AsBroadcaster.initialize(this);
this.init();
};
C_DealButtonCLASS.prototype = new MovieClip();
C_DealButtonCLASS.prototype.init = function()
{
this.keys = [13];
this.onKeyDown = function()
{
var a = this.keys;
var k = Key.getCode();
var i = 0;
while(i < a.length)
{
if(k == a[i])
{
this.onButtonPress();
}
i++;
}
};
var b = this.dealButton_btn;
b.onRelease = function()
{
this._parent.onButtonPress();
};
b.onRollOver = b.onDragOver = function()
{
this._parent.onButtonFocus();
};
b.onDragOut = b.releaseOutside = b.onRollOut = function()
{
this._parent.onButtonBlur();
};
if(b)
{
Key.addListener(this);
}
if(this.label != undefined)
{
this.setLabel(this.label);
}
};
C_DealButtonCLASS.prototype.lock = function()
{
this.locked = true;
this.onRelease = function()
{
};
this.useHandCursor = false;
this.dealButton_btn._brightness = -40;
this.label_mc._brightness = -40;
this.onButtonBlur();
};
C_DealButtonCLASS.prototype.unlock = function()
{
this.locked = false;
delete this.onRelease;
delete this.useHandCursor;
this.dealButton_btn._brightness = 0;
this.label_mc._brightness = 0;
};
C_DealButtonCLASS.prototype.onButtonPress = function()
{
if(this.locked)
{
return undefined;
}
if(this.hint != undefined)
{
this.hideAlt();
}
var c = this.client;
c.client[c.handler]();
this.client.client._caller = this;
this.broadcastMessage("onPress");
};
C_DealButtonCLASS.prototype.onButtonFocus = function()
{
if(this.locked)
{
return undefined;
}
if(this.hint != undefined)
{
this.showAlt(this.hint);
}
this.client.client._caller = this;
this.broadcastMessage("onFocus");
};
C_DealButtonCLASS.prototype.onButtonBlur = function()
{
if(this.hint != undefined)
{
this.hideAlt();
}
this.client.client._caller = this;
this.broadcastMessage("onBlur");
};
C_DealButtonCLASS.prototype.setChangeHandler = function(handler, client)
{
this.client = {handler:handler,client:client};
};
C_DealButtonCLASS.prototype.setKeys = function()
{
this.keys = [];
var i = 0;
while(i < arguments.length)
{
this.keys.push(arguments[i]);
i++;
}
};
C_DealButtonCLASS.prototype.setLabel = function(label)
{
this.label_mc.gotoAndStop(label);
};
ASSetPropFlags(_global,"C_DealButtonCLASS",131);
Object.registerClass("C_DealButtonCLASS",C_DealButtonCLASS);